/*
 * EDAS2 - TetraTech, Inc.
 *
 * Distributable under GPL license.
 * See terms of license at gnu.org.
 */
package com.tetratech.edas2.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * Country generated by hbm2java
 */
@Entity
@Table(name = "ED_COUNTRY")
public class Country extends AttributableUpdateRetireEntity
		implements
			java.io.Serializable {

	private Long uid;
	private String abbreviation;
	private String name;
	private Set<MonitoringLocation> monitoringLocations = new HashSet<MonitoringLocation>(
			0);
	private Set<State> states = new HashSet<State>(0);

	public Country() {
	}

	public Country(Long uid, String abbreviation, String name) {
		this.uid = uid;
		this.abbreviation = abbreviation;
		this.name = name;
	}

	@Id
	@Column(name = "CNTRY_UID", unique = true, nullable = false, precision = 6, scale = 0)
	@NotNull
	public Long getUid() {
		return this.uid;
	}

	public void setUid(Long uid) {
		this.uid = uid;
	}

	@Column(name = "CNTRY_CD", nullable = false, length = 2)
	@NotNull
	@Length(max = 2)
	public String getAbbreviation() {
		return this.abbreviation;
	}

	public void setAbbreviation(String abbreviation) {
		this.abbreviation = abbreviation;
	}

	@Column(name = "CNTRY_NAME", nullable = false, length = 35)
	@NotNull
	@Length(max = 35)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "country")
	public Set<MonitoringLocation> getMonitoringLocations() {
		return this.monitoringLocations;
	}

	public void setMonitoringLocations(
			Set<MonitoringLocation> monitoringLocations) {
		this.monitoringLocations = monitoringLocations;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "country")
	public Set<State> getStates() {
		return this.states;
	}

	public void setStates(Set<State> states) {
		this.states = states;
	}

}
